//
//  DCAvchatNetworkRequestAdapter.h
//  DCUtilKit
//
//  Created by 张涛 on 2021/3/29.
//  Copyright © 2021 zhangtao. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef void (^SuccessBlock)(NSDictionary *data);
typedef void (^FailureBlock)(NSDictionary *error);

@interface DCAvchatNetworkRequestAdapter : NSObject<NSURLSessionDelegate>

+ (instancetype) sharedNetworkRequestAdapter;

/**
 *  get请求
 */
- (void)getWithUrlString:(NSString *)url header:(__nullable id)header parameters:(id)parameters success:(SuccessBlock)successBlock failure:(FailureBlock)failureBlock;

/**
 * post请求
 */
- (void)postWithUrlString:(NSString *)url header:(__nullable id)header parameters:(id)parameters success:(SuccessBlock)successBlock failure:(FailureBlock)failureBlock;

/**
 * put请求
 */
- (void)putWithUrlString:(NSString *)url header:(__nullable id)header parameters:(id)parameters success:(SuccessBlock)successBlock failure:(FailureBlock)failureBlock;

@end

NS_ASSUME_NONNULL_END
